<template>
	<view class="area">
		<!-- #ifndef MP-WEIXIN -->
		<u-navbar :autoBack="true" title="填写内容" bgColor="#fff" :fixed="true" @rightClick="submit">
			<view slot="right">
				<text style="padding: 5px 16px;border-radius: 12px;background: #45C4B0;font-size: 10px;color: #fff;">完成</text>
			</view>
		</u-navbar>
		<!-- #endif -->
		
		<textarea auto-height="true" placeholder="请输入标题..." v-model="content"></textarea>
		<!-- #ifdef MP-WEIXIN -->
		<view class="ti" @click="submit()">
			完成
		</view>
		<!-- #endif -->
	</view>
</template>

<script>
	export default{
		data(){
			return {
				content: '',
				type: '',
				id: ''
			}
		},
		onLoad(options) {
			this.type = options.type || ''
			this.id = options.id || ''
			
			if(options.type && options.type == 1 && uni.getStorageSync('duration'+ options.id)){
				this.content = uni.getStorageSync('duration'+ options.id)
			}
			if(options.type && options.type == 2 && uni.getStorageSync('industry'+ options.id)){
				this.content = uni.getStorageSync('industry'+ options.id)
			}
			if(options.type && options.type == 3 && uni.getStorageSync('experience'+ options.id)){
				this.content = uni.getStorageSync('experience'+ options.id)
			}
		},
		methods:{
			submit(){
				if(!this.content){
					this.$common.errorToShow('请输入')
					return
				}
				
				uni.redirectTo({
					url: '/showcase/showcase/authen?content=' + this.content + '&type=' + this.type + '&id=' + this.id
				})
			}
		}
	}
</script>

<style scoped lang="scss">
	page{
		background-color: #fff;
	}
	.area{
		border-top: 10rpx solid #F2F5F2;
		padding: 20px 15px;
		font-family: '思源黑体';
		font-size: 14px;
		color: #999999;
		/* #ifndef MP-WEIXIN */
		margin-top: calc(var(--status-bar-height) + 50px);
		/* #endif */
		
		.textarea{
			width: 100%;
		}
	}
	
	.ti {
		position: fixed;
		bottom: calc(var(--window-bottom) + 50px);
		left: 50%;
		transform: translateX(-50%);
		width: 630rpx;
		height: 86rpx;
		border-radius: 8px;
		line-height: 86rpx;
		margin: 0 auto;
		opacity: 1;
		background: #45C4B0;
		font-size: 32rpx;
		font-weight: bold;
		text-align: center;
		letter-spacing: 0em;
		color: #FFFFFF;
	}
</style>